<?php

/**
 *  @FileComment            [订单列表模型]
 *  @ProjectName             项目名称：shopFrame
 *  @FileName                   文件名称：OrderListModel.class.php
 *  @Author                       yuerengui <596580041@qq.com>
 *  @Date                          2014-10-19 17:43:52
 *  *
 */
class OrderListModel extends Model {

        public $table = 'order_list';

        public function add_data($data) {
                return $this->add($data);
        }

        public function update_data($olid) {
                return $this->where(array('olid' => $olid))->update(array('orderstatu' => '已发货'));
        }

        public function update_send_data($olid) {
                return $this->where(array('olid' => $olid))->update(array('orderstatu' => '已完成'));
        }

        public function get_comment_order($oid) {
                return $this->where('order_oid in(' . $oid . ') and orderstatu="已完成"')->getField('goods_gid', TRUE);
        }

        public function get_sum_comment($oid) {
                return $this->where('order_oid in(' . $oid . ') and orderstatu="已完成"')->count();
        }

}
